package com.front.teacher.teacherapp.view.fragment;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.front.teacher.teacherapp.R;
import com.front.teacher.teacherapp.base.BaseFragment;
import com.front.teacher.teacherapp.presenter.MinePresenter;
import com.front.teacher.teacherapp.utils.ActivityTools;
import com.front.teacher.teacherapp.view.activity.mine.CallusActivity;
import com.front.teacher.teacherapp.view.activity.mine.CleanupcacheActivity;
import com.front.teacher.teacherapp.view.activity.mine.Fbzjctivity;
import com.front.teacher.teacherapp.view.activity.mine.HelpActivity;
import com.front.teacher.teacherapp.view.activity.mine.MyPingJiaActivity;
import com.front.teacher.teacherapp.view.activity.mine.MyPingLunActivity;
import com.front.teacher.teacherapp.view.activity.mine.PersonalZiLiaoActivity;
import com.front.teacher.teacherapp.view.activity.mine.TongJiActivity;
import com.front.teacher.teacherapp.view.impl.IMineView;
import com.front.teacher.teacherapp.weight.RoundImageView;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/**
 * 我的碎片
 */
public class MineFragment extends BaseFragment<IMineView, MinePresenter> implements IMineView {
public static MineFragment mineFragment;
    public static MineFragment newInstance(){
        if ( mineFragment== null){
            mineFragment = new MineFragment();
        }
        return mineFragment;
    }

    @InjectView(R.id.head_img)
    RoundImageView headImg;
    @InjectView(R.id.name_personalcenter)
    TextView namePersonalcenter;
    @InjectView(R.id.linear1)
    LinearLayout linear1;
    @InjectView(R.id.center_xxzx)
    RelativeLayout centerXxzx;
    @InjectView(R.id.center_mypingjia)
    RelativeLayout centerMypingjia;
    @InjectView(R.id.center_mypinglun)
    RelativeLayout centerMypinglun;
    @InjectView(R.id.center_fbzj)
    RelativeLayout centerFbzj;
    @InjectView(R.id.center_tongji)
    RelativeLayout centerTongji;
    @InjectView(R.id.center_help)
    RelativeLayout centerHelp;
    @InjectView(R.id.center_callus)
    RelativeLayout centerCallus;
    @InjectView(R.id.center_wipecache)
    RelativeLayout centerWipecache;
    @InjectView(R.id.exit)
    Button exit ;


    @Override
    public MinePresenter initPresenter() {
        return new MinePresenter(this);
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_mine;
    }

    @Override
    protected void initData() {


    }

    @Override
    protected void initView() {


    }




    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.reset(this);
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.inject(this, rootView);
        return rootView;
    }

    @OnClick({R.id.head_img, R.id.name_personalcenter, R.id.linear1, R.id.center_xxzx, R.id.center_mypingjia,
            R.id.center_mypinglun, R.id.center_fbzj, R.id.center_tongji,
            R.id.center_help,R.id.center_wipecache,R.id.center_callus})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.head_img:
                Bundle bundle = new Bundle();
                bundle.putString("df", "ds");

                ActivityTools.goNextActivityForResult(getContext(), PersonalZiLiaoActivity.class, bundle, 1);
                break;
            case R.id.name_personalcenter:
                break;
            case R.id.linear1:
                break;
            case R.id.center_xxzx:
                break;
            case R.id.center_mypingjia:
                ActivityTools.goNextActivity(getContext(), MyPingJiaActivity.class);
                break;
            case R.id.center_mypinglun:
                ActivityTools.goNextActivity(getContext(), MyPingLunActivity.class);
                break;
            case R.id.center_fbzj:
                ActivityTools.goNextActivity(getContext(), Fbzjctivity.class);
                break;
            case R.id.center_tongji:
                ActivityTools.goNextActivity(getContext(), TongJiActivity.class);
                break;
            case R.id.center_help:
                ActivityTools.goNextActivity(getContext(), HelpActivity.class);
                break;
            case R.id.center_callus:
                ActivityTools.goNextActivity(getContext(),CallusActivity.class);
                break;
            case R.id.center_wipecache:
                ActivityTools.goNextActivity(getContext(), CleanupcacheActivity.class);
                break;

        }
    }
}
